<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>一元的正负</title>
    <script>
        /* 
            一元的±
                + 不会改变数值的符号
                - 负号 取反
                当我们对非数值类型进行正负运算时，会将其转为数值再运算
        */
       let a=1,b = "1";
       a=+a;
       console.log(a)
       a+=a
       console.log(a);
       console.log(b,typeof b)
       b=+b;  // b=Number(b)
       console.log(b,typeof b)

    </script>
</head>
<body>
    
</body>
</html>